<div class="blexports index">
	<h2><?php __('Blacklists Exports');?></h2>
	<br><br>
	Download all Files for processed Blacklist entries (letter, interactions and ctsp data).
	<br>
	<br>
	<?php echo $this->Html->link('Download Files Briefe',array('controller' => 'blexports', 'action' => 'export1', '?' => array('pid' => $pid))); ?>  
	<?php $result1 = mysql_query("SELECT COUNT(*) AS count FROM macs AS m, mactypes AS mt, runshasmacs AS rhm, customers AS c, customershasmacs AS chm, blacklists AS b, runs AS r WHERE m.id = rhm.mac_id AND m.mactype_id = mt.id AND c.id = chm.customer_id AND m.id = chm.mac_id AND b.mac_id = m.id AND rhm.run_id = r.id AND r.project_id = '$pid' AND b.letter = 1"); $count1 = mysql_fetch_object($result1)->count; echo " (".$count1.")"; ?> 
	<br>
	<?php echo $this->Html->link('Download Files CTSP',array('controller' => 'blexports', 'action' => 'export2', '?' => array('pid' => $pid))); ?>   
	<?php $result2 = mysql_query("SELECT COUNT(*) AS count FROM macs AS m, mactypes AS mt, runshasmacs AS rhm, customers AS c, customershasmacs AS chm, blacklists AS b, runs AS r WHERE m.id = rhm.mac_id AND m.mactype_id = mt.id AND c.id = chm.customer_id AND m.id = chm.mac_id AND b.mac_id = m.id AND rhm.run_id = r.id AND r.project_id = '$pid' AND b.ctsp = 1"); $count2 = mysql_fetch_object($result2)->count; echo " (".$count2.")"; ?>
	<br>
	<?php echo $this->Html->link('Download Files Interactions',array('controller' => 'blexports', 'action' => 'export3', '?' => array('pid' => $pid))); ?>   
	<?php $result3 = mysql_query("SELECT COUNT(*) AS count FROM macs AS m, mactypes AS mt, runshasmacs AS rhm, customers AS c, customershasmacs AS chm, blacklists AS b, runs AS r WHERE m.id = rhm.mac_id AND m.mactype_id = mt.id AND c.id = chm.customer_id AND m.id = chm.mac_id AND b.mac_id = m.id AND rhm.run_id = r.id AND r.project_id = '$pid' AND b.interaction = 1"); $count3 = mysql_fetch_object($result3)->count; echo " (".$count3.")"; ?>
</div>